<?php

namespace App\Http\Requests\My;

use App\Http\Requests\Request;

class ResetPwdRequest extends Request
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        return [
            'oldPwd'=>'required|min:6|max:20',
            'newPwd'=>'required|min:6|max:20|',
            //'password_confirmation'=>'required',confirmed
        ];
    }
    public function messages()
    {
        return[
            'oldPwd.required'=>'请填写原密码',
            'oldPwd.min'=>'密码长度至少为6位',
            'oldPwd.max'=>'密码长度不超过20位',
            'newPwd.required'=>'请填写新密码',
            'newPwd.min'=>'密码长度至少为6位',
            'newPwd.max'=>'密码长度不超过20位',
            //'newPwd.confirmed'=>'密码确认不匹配',
            'password_confirmation.required'=>'请确认新密码',

        ];
    }
}
